summaryrefslogblamecommitdiffstats
path: root/src/metainfo.h
blob: 8af9e5258612c810bc9937a932708ebcf575bbea (plain) (tree)
1
2
3
4


                                
                              
































                                                                          
typedef unsigned inode_length_t;
struct inode {
	char * name;
	inode_length_t length;
	struct inode * next;
	struct inode * child;
	struct inode * parent;
};
const struct inode * next_file (const struct inode * inode);
const struct inode * next_inode (const struct inode * inode, int * paths);
enum type {
	UNSPEC = 0,
	V1 = 1,
	V2 = 2,
	HYBRID = 1 | 2
};
char * type_str[] = { "UNSPEC", "V1", "V2", "HYBRID" };
struct metainfo {
	struct inode * files;
	struct sockaddr_in6 ip;
	time_t retrieved;
	time_t created;
	enum type type;
	unsigned char sha1[20];
	unsigned char sha256[32];
	char * name;
	char * client;
	char * source;
	char * publisher;
	char * publisher_url;
	char * comment;
	unsigned filecount;
	inode_length_t length;
};
void metainfo_free (struct metainfo * metainfo);
struct metainfo * parse (const char * data, off_t size);
int directory (const char * path, struct metainfo *** out);